package com.springinaction.knights.ioc.demo01;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * 使用XML配置Bean完成依赖注入
 */
public class KnightMain {

    public static void main(String[] args) {

        ApplicationContext context = new ClassPathXmlApplicationContext("springBean/demo01/knight.xml");
        Knight knight = (BraveKnight) context.getBean("knight");
        knight.embarkOnQuest();
    }
}
